#!/bin/bash

SERVER=$1
if [[ -z ${SERVER} ]]; then
  SERVER=`/niagara/test/scripts/getserverpriv.py`
fi

CARS=500
VERBOSE=false
SSL=true
PORT=5004
VERBOSE_CONNECT=true
IOTF=false
CACERTS=/niagara/test/svt_jmqtt/ssl/cacerts.jks
PASSWORD=k1ngf1sh

printf -v ID "c%08d" $2

export MALLOC_ARENA_MAX=2

echo java -Xss128K -Xzero -Xms128M -Xmx128M -Xshareclasses -Djavax.net.debug=false -Djavax.net.ssl.trustStore=${CACERTS} -Djavax.net.ssl.trustStorePassword=${PASSWORD} svt.scale.vehicle.SVTVehicle -server "${SERVER}" -mode "connect_once" -userName ${ID} -password "svtpvtpass" -port ${PORT} -qos 0 -paho ${CARS} -messages 1000000 -vverbose ${VERBOSE} -listener false -iotf ${IOTF} -ssl ${SSL} -cleanSession false -rate 60 -verbose_connect ${VERBOsE_CONNECT} -genClientID false -verbose_connectionLost true -reconnectDelay 60000  -keepAlive 900 -connectionTimeout 240
java -Xss128K -Xzero -Xms128M -Xmx128M -Xshareclasses -Djavax.net.debug=false -Djavax.net.ssl.trustStore=${CACERTS} -Djavax.net.ssl.trustStorePassword=${PASSWORD} svt.scale.vehicle.SVTVehicle -server "${SERVER}" -mode "connect_once" -userName ${ID} -password "svtpvtpass" -port ${PORT} -qos 0 -paho ${CARS} -messages 1000000 -vverbose ${VERBOSE} -listener false -iotf ${IOTF} -ssl ${SSL} -cleanSession false -rate 60 -verbose_connect ${VERBOsE_CONNECT} -genClientID false -verbose_connectionLost true -reconnectDelay 60000  -keepAlive 900 -connectionTimeout 240

